﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/AdminMaster.master" AutoEventWireup="true"
    CodeFile="EmailByStatus.aspx.cs" Inherits="Admin_EmailByStatus" %>

<script runat="server">

   
</script>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    
    <table style="width: 100%" id="TABLE1" cellspacing="1" cellpadding="1" border="0">
        <tbody>
            <tr>
                <td style="height: 30px; text-align: center" colspan="3">
                    <table id="TABLE3"  style="vertical-align: middle;width: 100%;" >
                        <tbody>
                            <tr>
                                <td colspan="2" style="text-align: left;">
                                    <h2>Email Status Log</h2>
                                </td>
                            </tr>
                            <tr>
                            <td align="right" colspan="2" style="height: 30px; text-align: center">
                        
                                    <asp:Label ID="lblMessage" runat="server" Font-Bold="True" ></asp:Label>
                               </td>
                         </tr>
                            
                            <tr>
                                <td style="vertical-align: middle;" align="right" class="auto-style3">
                                           Type Name<font color="red">*</font>&nbsp;&nbsp;:&nbsp;&nbsp;
                                        </td>
                               <td style="width: 30%;vertical-align: middle; text-align: left;">
                                            &nbsp;
                                            <asp:DropDownList ID="activitydropdown" runat="server" Width="245px"  DataValueField="ActivityName" OnSelectedIndexChanged="activitydropdown_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>

                               <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="activitydropdown" ErrorMessage="Please Select Type Name" ForeColor="Red"></asp:RequiredFieldValidator></td></tr>
                            
                            <tr>
                                <td style="vertical-align: middle;" align="right" class="auto-style3">
                                           Email Template Name<font color="red">*</font>&nbsp;&nbsp;:&nbsp;&nbsp;
                                        </td>
                               <td style="width: 30%;vertical-align: middle;" class="text-left">
                                            &nbsp;
                                            <asp:DropDownList ID="emailtemplatedropdown" runat="server" Width="245px"  DataValueField="EmailSubject" AutoPostBack="true" ></asp:DropDownList>
                                   <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="emailtemplatedropdown" ErrorMessage="Please Select Email Template" ForeColor="Red"></asp:RequiredFieldValidator>
                               </td></tr>
                                    <tr>
                                <td style="vertical-align: middle;" align="right" class="auto-style3">
                                           Email Status<font color="red">*</font>&nbsp;&nbsp;:&nbsp;&nbsp;
                                        </td>
                               <td  style="width: 30%;vertical-align: middle;" class="text-left">&nbsp;&nbsp;<asp:DropDownList ID="emailstatus" runat="server" Width="245px" ></asp:DropDownList>
                                   &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="emailstatus" ErrorMessage="Please Select Email Status" ForeColor="Red"></asp:RequiredFieldValidator>
                               </td></tr>
                            
                               
                            </tr>
                                    <tr>
                                <td style="vertical-align: middle;" align="right" class="auto-style3">
                                           &nbsp;</td>
                               <td  style="width: 30%;vertical-align: middle;" class="text-left">&nbsp;</td></tr>
                            
                               
                                    <tr>
                                <td style="vertical-align: middle;" align="right" class="auto-style3">
                                           &nbsp;</td>
                               <td  style="width: 30%;vertical-align: middle;" class="text-left">            <asp:Button ID="Button1" OnClick="BtnSearch_OnClick" runat="server"
                                                Text="Search" CausesValidation="false"></asp:Button>
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:Button ID="Button2" OnClick="BtnClear_OnClick" runat="server"
                                                Text="Clear" CausesValidation="false"></asp:Button>
                               </td></tr>
                            
                               
                        </tbody>
                    </table>
                </td>
            </tr>
             <tr>
                <td  align="center" colspan="3" >            &nbsp;&nbsp;
                                            &nbsp;&nbsp; <br />
                    </td>
                 </tr>
             <tr>
                <td colspan="3" style="text-align:center;"> <asp:Label runat="server" ID="lblErrorMessage"  ></asp:Label>
                    </td>
                 </tr>
            <tr>
                <td align="center"  colspan="3">
                    <div class="grd_table" style="overflow-x: auto; width: 950px;">  
                        <%--SELECT ActivityName,EmailSubject,EmailQueueID,EmailTemplateID,UserIDToFullName,UserIDTo,RoleName,EmailSentDisplayName,EmailBody,EmailErrorMsg FROM VW_EMAILQUEUE WHERE 1=1--%>                 
                        <asp:GridView ID="gvSearchResult" runat="server" DataKeyNames="EmailQueueID" AllowPaging="True" Width="50%" PageSize="10"
                            AutoGenerateColumns="False" OnPageIndexChanging="gvSearchResult_PageIndexChanging">
                            <Columns>
                                <asp:TemplateField ItemStyle-HorizontalAlign="center">
                                   <ItemTemplate>
                                       <asp:CheckBox type="checkbox" runat="server"  id="chkIsActive"  enableviewstate="true" />                                       
                                    </ItemTemplate>
                                    <ItemStyle Width="2%" />
                                </asp:TemplateField>
                                <%--<asp:BoundField DataField="ActivityName" HeaderText="Activity Name" />--%>
                               <asp:BoundField DataField="EmailQueueID" HeaderText="Queue ID"  Visible="true" HeaderStyle-Wrap="false">
                                    <ItemStyle   HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="UserIDToFullName" HeaderText="Email To Full Name" ItemStyle-Wrap="false" HeaderStyle-Wrap="false">
                                    <ItemStyle Width="20%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>  
                                <asp:BoundField DataField="UserIDTo" HeaderText="Email To" ItemStyle-Wrap="false"/>
                                
                                <asp:TemplateField HeaderText="Email Subject" HeaderStyle-Wrap="false"  ItemStyle-Wrap="false">
                                    <ItemTemplate>
                                        <asp:Label ID="lblEmailSubject" runat="server" Text='<%# (Eval("EmailSubject")) %>' tooltip='<%# Eval("EmailBody") %>' ></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Email Status" HeaderStyle-Wrap="false">
                                    <ItemTemplate>
                                        <asp:Label ID="lblEmailSentDisplayName" runat="server" Text='<%# Eval("EmailSentDisplayName") %>' tooltip='<%# Eval("EmailErrorMsg") %>' ></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                                                
                                <asp:BoundField DataField="ModifyDate" HeaderText="Email Sent Date"  HeaderStyle-Wrap="false" HtmlEncode="false" DataFormatString="{0:d}"  />

                                <%--<asp:BoundField DataField="EmailSubject" HeaderText="Email Subject"  />                                
                                <asp:BoundField DataField="EmailBody" HeaderText="Email Body"  />
                                <asp:BoundField DataField="EmailSentDisplayName" HeaderText="Email Status" ItemStyle-Wrap="false" />
                                <asp:BoundField DataField="EmailErrorMsg" HeaderText="Email Error Msg" />--%>

                                
                            </Columns>
                             <FooterStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#E2DED6" ForeColor="blue" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#CCCCCC" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        </asp:GridView>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="right" colspan="3">
                    <input id="hdnInput" runat="server" type="hidden" />
                   
                </td>
            </tr>
            <tr>
                <td align="right" colspan="3" style="height: 30px; text-align: center">
                               
                    <asp:Button ID="btnSave" runat="server" SkinID="buttonSkin" Text="Resend selected emails" OnClick="btnSave_Click" />
                    &nbsp; &nbsp;
                              
                </td>
            </tr>
                      
        </tbody>
    </table>
         
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="head">
    <style type="text/css">
        
        .auto-style3 {
            width: 30%;
        }

        </style>
</asp:Content>

